/**
 * $Id: Commandline.java 19 2006-09-16 20:29:16Z willi.w $
 */

package at.wwu.tunes2db;


public class Commandline {
    
    enum ArgEnum {
        other, input, output;
    }

    static ArgEnum arg = ArgEnum.other;

    private String input = null;

    private static Commandline instance = null;

    public static Commandline parse(String[] args) {
        instance = new Commandline();
        for (String cmd : args) {
            if (cmd.equals("-i")) {
                arg = ArgEnum.input;
            } else {
                switch (arg) {
                case input:
                    instance.input = cmd;
                    break;
                }
                arg = ArgEnum.other;
            }
        }        
        return instance;
    }

    public String getInput() {
        return input;
    }

    public void setInput(String input) {
        this.input = input;
    }

}
